home *** CD-ROM | disk | FTP | other *** search
/ MIDICraft's MIDINET CD-ROM / MIDICraft's MIDINET CD-ROM.iso / DOSUTILS / MIDI2TXT.DOC < prev    next >
Encoding:
Text File  |  1996-09-22  |  7.8 KB  |  219 lines

  1.         ******************************
  2.             MIDI2TXT v1.4
  3.     
  4.         midi binaries to text mnemonic  
  5.               by Guenter Nagler 
  6.                 1995 
  7.           (gnagler@ihm.tu-graz.ac.at)
  8.         ******************************
  9.  
  10. [1] BACKGROUND
  11. My first intention writing this program was getting knowledge about
  12. midi. After writing the pendant TXT2MIDI program I used it to sequence 
  13. some music titles. When I bought my music workstation (including a more
  14. powerful sequencer) my use of MIDI2TXT/TXT2MIDI changed into an
  15. updating environment to make less compatible midi files full compatible.
  16. Another use possibility came up when I copied some excellent midi
  17. binaries from news://alt.binaries.sounds.midi . I converted one with
  18. MIDI2TXT into text, commented all commands that played notes in leading
  19. track and converted it back into another midi file (TXT2MIDI). The new 
  20. midi file played the full background of the music while I was able to 
  21. learn playing the lead voice for my own pleasure.
  22.  
  23. [2] FILES DESCRIPTION
  24.  
  25. MIDI2TXT.EXE.........converter program
  26. MIDI2TXT.DOC.........this file, showing usage of MIDI2TXT.EXE
  27. MIDIIO.HPP...........header file for a c++ midi parser
  28. MIDIIO.CPP...........source code for a c++ midi parser
  29. MIDI2TXT.CPP.........c++ source code for midi to text
  30. MIDI2TXT.MAK.........make file for project 
  31. MIDI2TXT.CFG.........compiler options for make
  32. MIDI2TXT.PRJ.........project for borland c++ compilers
  33. only MIDI2TXT.EXE is required to run program
  34.  
  35. [3] COPYRIGHT
  36.  
  37. MIDI2TXT (c) 1995 was created by Guenter Nagler.
  38.  
  39. MIDI2TXT is free and may be used as you wish with this one exception:
  40.  
  41.     You may NOT charge any fee or derive any profit for distribution
  42.     of MIDI2TXT.  Thus, you may NOT sell or bundle MIDI2TXT with any 
  43.     product in a retail environment (shareware disk distribution, CD-ROM,
  44.     etc.) without permission of the author.
  45.  
  46. You may give MIDI2TXT to your friends, upload it to a BBS, or ftp it to
  47. another internet site, as long as you don't charge anything for it.
  48.  
  49. [4] DISCLAIMER
  50.  
  51. MIDI2TXT was designed to handle 100% compatible midi files.
  52. It was tested with 600 different midi files but I can not say if 
  53. each 100% midi compatible midi file can be correctly converted.
  54. So I give no guarantees of the results, especially with non 100% 
  55. compatible midi files.
  56. If you find a midi file that you think to be 100% compatible midi
  57. that is not correctly converted, please send a sample file to 
  58. gnagler@ihm.tu-graz.ac.at . 
  59.  
  60. Use MIDI2TXT at your own risk.  Anything you do with MIDI2TXT is your
  61. responsibility, and not the author's.  Any damage caused to any person,
  62. computer, software, hardware, company, or business by running MIDI2TXT 
  63. is your responsibility, and the author will not be liable.
  64.  
  65. If you don't understand these terms, or are not sure of something, or
  66. are afraid something bad might come of using MIDI2TXT, don't  use  it!
  67. You are here forewarned.
  68.  
  69. [5] INSTALLATION 
  70.  
  71. [MSDOS]
  72.  
  73.   Simply copy MIDI2TXT.EXE in a directory that is in your path.
  74.   When you start the program without arguments
  75.  
  76.   C:\> MIDI2TXT
  77.  
  78.   you should get the usage text (see next section)
  79.  
  80. [UNIX]
  81. compile sources with your C++ compiler (e.g. GNU Compiler g++):
  82.  
  83. g++ -o midi2txt midi2txt.cpp midiio.cpp
  84.  
  85. and run program
  86.  
  87. $ midi2txt
  88.  
  89. [6] USAGE
  90.  
  91. usage: MIDI2TXT [-error][-chunk][-short][-info][-lyric][-tact] file.mid [> file.txt]
  92.  
  93. The parts in brackets [...] are optional.
  94.  
  95. The text output is normally written to screen but can be relinked
  96. to a file  (> filename.txt)  or a printer (> prn). See your MS-DOS 
  97. manual for usage of  > and >> operators.
  98.  
  99. The program MIDI2TXT allows some options:
  100. -error  checks midifile for errors 
  101. -chunk  shows only the header and midi tracks (without contents, but 
  102.     channel number if available)
  103.  
  104. -short  shows only program changes and text information
  105.  
  106. -info   shows only program changes, bank changes, volume and text 
  107.     information (no notes and time delays)
  108.  
  109. -lyric  shows only text and lyric meta events and interprets special
  110.     character sequences in text (as used in some karaoke players):
  111.        / or \   as end of line, end of paragraph
  112.        @K    kind of midi file (usually karaoke)
  113.        @V    version
  114.        @I    information
  115.        @L    language
  116.        @T    title of file 
  117.  
  118. If none of the options -chunk, -short, -info, -lyric is specified all
  119. midi commands are printed.
  120.  
  121. -tact   marks all tact changes with a point and comments. 
  122.     This option is ignored if the song changes tact while playing.
  123.  
  124. Warning:
  125.   Do not expect that MIDI2TXT + TXT2MIDI will produce a copy of the original
  126.   file! MIDI allows to encode its commands in different ways without 
  127.   changing the semantic of the notes (It is allowed to compress the 
  128.   midi file by ommiting redunant command bytes, but it is no duty).
  129.       
  130. [7] A sample of resulting text output
  131.  
  132. // is a comment that ends at end of line (all characters are ignored)
  133. /* is a comment that ignores all characters, lines until */ 
  134. // the comments at right side are not produced by the program 
  135.  
  136. // sample.mid
  137. mthd                        // start of header
  138.   // 1 song                 // midi2txt converts only the first song!
  139.   // 3 tracks
  140.   unit 192 // is 1/4        // time units that build a quarter pause
  141. end mthd                    // end of header
  142.  
  143. mtrk                          // start of a track without channel
  144.   copyright "(c) Guenter Nagler"   // any copyright text 
  145.   trackname "Ballade pour Adeline" // any track name
  146.   tact 4 / 4 24 8                  // song in 4/4 tact, 24 clicks per beat, 8/32 is 1/4 note
  147.   beats 68                         // tempo in ticks/min or beats/min
  148. end mtrk                           // end of track
  149.  
  150. mtrk($D)                           // a track with channel D hex (=13 dec)
  151.   trackname "Melody"
  152.   program BritePiano               // program name
  153.   balance  left                    // a panpot control parameter
  154.   +c4 $40;                         // + are pressing keys, velocity as param
  155.   48;+g4 $40;                      // 48 is 1/16 duration (pause to next command)
  156.   48;-g4 $7F;                      // - are releasing keys, velocity as param
  157.   +c5 $40;                         // note commands are separated by ;
  158.   1/16;-c5 $7F;                    // exact aligned duration can be written as 1/16
  159.   +d5 $40;
  160.   1/16;-d5 $7F;
  161.   -c4 $7F;
  162.   +c4 $40;
  163.   1/16;+g4 $40;
  164.   1/16;-g4 $7F;
  165.   +c5 $40;
  166.   1/16;-c5 $7F;
  167.   +d5 $40;
  168.   1/16;-d5 $7F;
  169.   -c4 $7F;
  170.   +c4 $40;
  171.   1/16;+g4 $40;
  172.   1/16;-g4 $7F;
  173.   +c5 $40;
  174.   1/16;-c5 $7F;
  175.   +d5 $40;
  176.   1/16;-d5 $7F;
  177.   -c4 $7F;
  178.   +c4 $40;
  179.   1/16;+g4 $40;
  180.   1/16;-g4 $7F;
  181.   +c5 $40;
  182.   1/16;-c5 $7F;
  183.   +d5 $40;
  184.   1/16. // tact 1                       // end of tact 1  (using option -tact)
  185. end mtrk
  186.  
  187. A further description of the text language can be found in documentation
  188. of TXT2MIDI.
  189.  
  190. [8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
  191.  
  192.          WWW:    http://hgiicm.tu-graz.ac.at/Cpub
  193.           contains all my dos/unix midi programs
  194.          EMAIL:  gnagler@ihm.tu-graz.ac.at
  195.  
  196. [9] CHANGES
  197. v1.0 to v1.1: 
  198.   * added version field in midi header
  199.   * tempo is now printed by beats command as floatingpoint numbers
  200.   * new option -error checks if midifile is correct otherwise
  201.     prints an error message
  202.   * some portability changes for UNIX compatibility
  203. v1.1 to v1.2:
  204.   * added detailed sysex information for common sysex commands
  205.     (GMReset, GSReset, GSExit)
  206.   * minor bugs in output information level 
  207.  
  208. v1.2 to v1.3:
  209.   * added meta events mnemonics prefixchannel and prefixport
  210.  
  211. v1.3 to v1.4:
  212.   * bug fixed that caused unexpected end-of-file-error for certain valid midi files
  213.   * added -version option
  214.   * note B is now written as B (former H, as used in German language)
  215. v1.4 to v1.5:
  216.   * added RPN control commands highrpn, lowrpn
  217.   * fixed bug that generated negative number of quarternotes for very high
  218.     pause values
  219.   * added XGreset command